\(\int x^2 (a+b \log (c x^n))^3 \, dx\) [58]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 77 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=-\frac {2}{27} b^3 n^3 x^3+\frac {2}{9} b^2 n^2 x^3 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{3} b n x^3 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^3 \]

[Out]

-2/27*b^3*n^3*x^3+2/9*b^2*n^2*x^3*(a+b*ln(c*x^n))-1/3*b*n*x^3*(a+b*ln(c*x^n))^2+1/3*x^3*(a+b*ln(c*x^n))^3

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2342, 2341} \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=\frac {2}{9} b^2 n^2 x^3 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^3-\frac {1}{3} b n x^3 \left (a+b \log \left (c x^n\right )\right )^2-\frac {2}{27} b^3 n^3 x^3 \]

[In]

Int[x^2*(a + b*Log[c*x^n])^3,x]

[Out]

(-2*b^3*n^3*x^3)/27 + (2*b^2*n^2*x^3*(a + b*Log[c*x^n]))/9 - (b*n*x^3*(a + b*Log[c*x^n])^2)/3 + (x^3*(a + b*Lo
g[c*x^n])^3)/3

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^3-(b n) \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \, dx \\ & = -\frac {1}{3} b n x^3 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^3+\frac {1}{3} \left (2 b^2 n^2\right ) \int x^2 \left (a+b \log \left (c x^n\right )\right ) \, dx \\ & = -\frac {2}{27} b^3 n^3 x^3+\frac {2}{9} b^2 n^2 x^3 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{3} b n x^3 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right )^3 \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.87 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=\frac {1}{3} \left (x^3 \left (a+b \log \left (c x^n\right )\right )^3-b n \left (\frac {2}{9} b n x^3 \left (-3 a+b n-3 b \log \left (c x^n\right )\right )+x^3 \left (a+b \log \left (c x^n\right )\right )^2\right )\right ) \]

[In]

Integrate[x^2*(a + b*Log[c*x^n])^3,x]

[Out]

(x^3*(a + b*Log[c*x^n])^3 - b*n*((2*b*n*x^3*(-3*a + b*n - 3*b*Log[c*x^n]))/9 + x^3*(a + b*Log[c*x^n])^2))/3

Maple [A] (verified)

Time = 0.31 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.81

method result size
parallelrisch \(\frac {x^{3} b^{3} \ln \left (c \,x^{n}\right )^{3}}{3}-\frac {\ln \left (c \,x^{n}\right )^{2} x^{3} b^{3} n}{3}+\frac {2 \ln \left (c \,x^{n}\right ) x^{3} b^{3} n^{2}}{9}-\frac {2 b^{3} n^{3} x^{3}}{27}+x^{3} a \,b^{2} \ln \left (c \,x^{n}\right )^{2}-\frac {2 \ln \left (c \,x^{n}\right ) x^{3} a \,b^{2} n}{3}+\frac {2 a \,b^{2} n^{2} x^{3}}{9}+x^{3} a^{2} b \ln \left (c \,x^{n}\right )-\frac {a^{2} b n \,x^{3}}{3}+\frac {x^{3} a^{3}}{3}\) \(139\)
risch \(\text {Expression too large to display}\) \(2650\)

[In]

int(x^2*(a+b*ln(c*x^n))^3,x,method=_RETURNVERBOSE)

[Out]

1/3*x^3*b^3*ln(c*x^n)^3-1/3*ln(c*x^n)^2*x^3*b^3*n+2/9*ln(c*x^n)*x^3*b^3*n^2-2/27*b^3*n^3*x^3+x^3*a*b^2*ln(c*x^
n)^2-2/3*ln(c*x^n)*x^3*a*b^2*n+2/9*a*b^2*n^2*x^3+x^3*a^2*b*ln(c*x^n)-1/3*a^2*b*n*x^3+1/3*x^3*a^3

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 224 vs. \(2 (69) = 138\).

Time = 0.29 (sec) , antiderivative size = 224, normalized size of antiderivative = 2.91 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=\frac {1}{3} \, b^{3} n^{3} x^{3} \log \left (x\right )^{3} + \frac {1}{3} \, b^{3} x^{3} \log \left (c\right )^{3} - \frac {1}{3} \, {\left (b^{3} n - 3 \, a b^{2}\right )} x^{3} \log \left (c\right )^{2} + \frac {1}{9} \, {\left (2 \, b^{3} n^{2} - 6 \, a b^{2} n + 9 \, a^{2} b\right )} x^{3} \log \left (c\right ) - \frac {1}{27} \, {\left (2 \, b^{3} n^{3} - 6 \, a b^{2} n^{2} + 9 \, a^{2} b n - 9 \, a^{3}\right )} x^{3} + \frac {1}{3} \, {\left (3 \, b^{3} n^{2} x^{3} \log \left (c\right ) - {\left (b^{3} n^{3} - 3 \, a b^{2} n^{2}\right )} x^{3}\right )} \log \left (x\right )^{2} + \frac {1}{9} \, {\left (9 \, b^{3} n x^{3} \log \left (c\right )^{2} - 6 \, {\left (b^{3} n^{2} - 3 \, a b^{2} n\right )} x^{3} \log \left (c\right ) + {\left (2 \, b^{3} n^{3} - 6 \, a b^{2} n^{2} + 9 \, a^{2} b n\right )} x^{3}\right )} \log \left (x\right ) \]

[In]

integrate(x^2*(a+b*log(c*x^n))^3,x, algorithm="fricas")

[Out]

1/3*b^3*n^3*x^3*log(x)^3 + 1/3*b^3*x^3*log(c)^3 - 1/3*(b^3*n - 3*a*b^2)*x^3*log(c)^2 + 1/9*(2*b^3*n^2 - 6*a*b^
2*n + 9*a^2*b)*x^3*log(c) - 1/27*(2*b^3*n^3 - 6*a*b^2*n^2 + 9*a^2*b*n - 9*a^3)*x^3 + 1/3*(3*b^3*n^2*x^3*log(c)
 - (b^3*n^3 - 3*a*b^2*n^2)*x^3)*log(x)^2 + 1/9*(9*b^3*n*x^3*log(c)^2 - 6*(b^3*n^2 - 3*a*b^2*n)*x^3*log(c) + (2
*b^3*n^3 - 6*a*b^2*n^2 + 9*a^2*b*n)*x^3)*log(x)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 156 vs. \(2 (73) = 146\).

Time = 0.32 (sec) , antiderivative size = 156, normalized size of antiderivative = 2.03 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=\frac {a^{3} x^{3}}{3} - \frac {a^{2} b n x^{3}}{3} + a^{2} b x^{3} \log {\left (c x^{n} \right )} + \frac {2 a b^{2} n^{2} x^{3}}{9} - \frac {2 a b^{2} n x^{3} \log {\left (c x^{n} \right )}}{3} + a b^{2} x^{3} \log {\left (c x^{n} \right )}^{2} - \frac {2 b^{3} n^{3} x^{3}}{27} + \frac {2 b^{3} n^{2} x^{3} \log {\left (c x^{n} \right )}}{9} - \frac {b^{3} n x^{3} \log {\left (c x^{n} \right )}^{2}}{3} + \frac {b^{3} x^{3} \log {\left (c x^{n} \right )}^{3}}{3} \]

[In]

integrate(x**2*(a+b*ln(c*x**n))**3,x)

[Out]

a**3*x**3/3 - a**2*b*n*x**3/3 + a**2*b*x**3*log(c*x**n) + 2*a*b**2*n**2*x**3/9 - 2*a*b**2*n*x**3*log(c*x**n)/3
 + a*b**2*x**3*log(c*x**n)**2 - 2*b**3*n**3*x**3/27 + 2*b**3*n**2*x**3*log(c*x**n)/9 - b**3*n*x**3*log(c*x**n)
**2/3 + b**3*x**3*log(c*x**n)**3/3

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.74 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=\frac {1}{3} \, b^{3} x^{3} \log \left (c x^{n}\right )^{3} + a b^{2} x^{3} \log \left (c x^{n}\right )^{2} - \frac {1}{3} \, a^{2} b n x^{3} + a^{2} b x^{3} \log \left (c x^{n}\right ) + \frac {1}{3} \, a^{3} x^{3} + \frac {2}{9} \, {\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} a b^{2} - \frac {1}{27} \, {\left (9 \, n x^{3} \log \left (c x^{n}\right )^{2} + 2 \, {\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} n\right )} b^{3} \]

[In]

integrate(x^2*(a+b*log(c*x^n))^3,x, algorithm="maxima")

[Out]

1/3*b^3*x^3*log(c*x^n)^3 + a*b^2*x^3*log(c*x^n)^2 - 1/3*a^2*b*n*x^3 + a^2*b*x^3*log(c*x^n) + 1/3*a^3*x^3 + 2/9
*(n^2*x^3 - 3*n*x^3*log(c*x^n))*a*b^2 - 1/27*(9*n*x^3*log(c*x^n)^2 + 2*(n^2*x^3 - 3*n*x^3*log(c*x^n))*n)*b^3

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 256 vs. \(2 (69) = 138\).

Time = 0.33 (sec) , antiderivative size = 256, normalized size of antiderivative = 3.32 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=\frac {1}{3} \, b^{3} n^{3} x^{3} \log \left (x\right )^{3} - \frac {1}{3} \, b^{3} n^{3} x^{3} \log \left (x\right )^{2} + b^{3} n^{2} x^{3} \log \left (c\right ) \log \left (x\right )^{2} + \frac {2}{9} \, b^{3} n^{3} x^{3} \log \left (x\right ) - \frac {2}{3} \, b^{3} n^{2} x^{3} \log \left (c\right ) \log \left (x\right ) + b^{3} n x^{3} \log \left (c\right )^{2} \log \left (x\right ) + a b^{2} n^{2} x^{3} \log \left (x\right )^{2} - \frac {2}{27} \, b^{3} n^{3} x^{3} + \frac {2}{9} \, b^{3} n^{2} x^{3} \log \left (c\right ) - \frac {1}{3} \, b^{3} n x^{3} \log \left (c\right )^{2} + \frac {1}{3} \, b^{3} x^{3} \log \left (c\right )^{3} - \frac {2}{3} \, a b^{2} n^{2} x^{3} \log \left (x\right ) + 2 \, a b^{2} n x^{3} \log \left (c\right ) \log \left (x\right ) + \frac {2}{9} \, a b^{2} n^{2} x^{3} - \frac {2}{3} \, a b^{2} n x^{3} \log \left (c\right ) + a b^{2} x^{3} \log \left (c\right )^{2} + a^{2} b n x^{3} \log \left (x\right ) - \frac {1}{3} \, a^{2} b n x^{3} + a^{2} b x^{3} \log \left (c\right ) + \frac {1}{3} \, a^{3} x^{3} \]

[In]

integrate(x^2*(a+b*log(c*x^n))^3,x, algorithm="giac")

[Out]

1/3*b^3*n^3*x^3*log(x)^3 - 1/3*b^3*n^3*x^3*log(x)^2 + b^3*n^2*x^3*log(c)*log(x)^2 + 2/9*b^3*n^3*x^3*log(x) - 2
/3*b^3*n^2*x^3*log(c)*log(x) + b^3*n*x^3*log(c)^2*log(x) + a*b^2*n^2*x^3*log(x)^2 - 2/27*b^3*n^3*x^3 + 2/9*b^3
*n^2*x^3*log(c) - 1/3*b^3*n*x^3*log(c)^2 + 1/3*b^3*x^3*log(c)^3 - 2/3*a*b^2*n^2*x^3*log(x) + 2*a*b^2*n*x^3*log
(c)*log(x) + 2/9*a*b^2*n^2*x^3 - 2/3*a*b^2*n*x^3*log(c) + a*b^2*x^3*log(c)^2 + a^2*b*n*x^3*log(x) - 1/3*a^2*b*
n*x^3 + a^2*b*x^3*log(c) + 1/3*a^3*x^3

Mupad [B] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.40 \[ \int x^2 \left (a+b \log \left (c x^n\right )\right )^3 \, dx=x^3\,\left (\frac {a^3}{3}-\frac {a^2\,b\,n}{3}+\frac {2\,a\,b^2\,n^2}{9}-\frac {2\,b^3\,n^3}{27}\right )+\frac {x^3\,\ln \left (c\,x^n\right )\,\left (3\,a^2\,b-2\,a\,b^2\,n+\frac {2\,b^3\,n^2}{3}\right )}{3}+x^3\,{\ln \left (c\,x^n\right )}^2\,\left (a\,b^2-\frac {b^3\,n}{3}\right )+\frac {b^3\,x^3\,{\ln \left (c\,x^n\right )}^3}{3} \]

[In]

int(x^2*(a + b*log(c*x^n))^3,x)

[Out]

x^3*(a^3/3 - (2*b^3*n^3)/27 + (2*a*b^2*n^2)/9 - (a^2*b*n)/3) + (x^3*log(c*x^n)*(3*a^2*b + (2*b^3*n^2)/3 - 2*a*
b^2*n))/3 + x^3*log(c*x^n)^2*(a*b^2 - (b^3*n)/3) + (b^3*x^3*log(c*x^n)^3)/3